package com.necsv;

import android.app.Activity;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.webkit.WebView;
import android.webkit.WebViewClient;
import android.widget.Button;

public class WebviewActivity extends Activity {
	private static final String TAG = "WebviewActivity";
	private static final String URL_VNEXPRESS = "http://vnexpress.net";
	private static final String URL_24H = "http://24h.com.vn";
	private WebView webkit;

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		// TODO Auto-generated method stub
		GoogleAnaTool.trackPage("WebviewActivity");
		super.onCreate(savedInstanceState);
		setContentView(R.layout.webview);
		webkit = (WebView)findViewById(R.id.webview);
		webkit.loadUrl(URL_VNEXPRESS);
	}
	
	@Override
	protected void onDestroy() {
		// TODO Auto-generated method stub
		GoogleAnaTool.stop(this);
		super.onDestroy();
		
	}
	
	public void btn_onClick(View v)
	{
		Button btn = (Button)v;
		switch (btn.getId()) {
		case R.id.btnWeb1:
			Log.v(TAG, "web1");
			webkit.loadUrl(URL_VNEXPRESS);
			break;
		case R.id.btnWeb2:
			Log.v(TAG, "web2");
			webkit.loadUrl(URL_24H);
		default:
			break;
		}
	}
}
